home *** CD-ROM | disk | FTP | other *** search
/ Larry Magid's Essential Internet / Larry Magid's Essential Internet (Quarterdeck Corporation)(1995).ISO / qsockpro.qip / NETAXIS.MPS < prev    next >
Text File  |  1995-10-09  |  2KB  |  74 lines

  1. # Net Axis PPP and SLIP login script
  2. # Copyright 1995 Quarterdeck Office Systems
  3. # 5-9-95 CEL
  4.  
  5. #define the variables we will need
  6.  
  7. STRING username
  8. STRING password
  9. STRING framing
  10. STRING IPAddress
  11.  
  12. # uncomment for debugging
  13. # TRACE ON
  14.  
  15. # reset maximum login timeout.  
  16.  
  17. SetTimeout 90             
  18.  
  19. CfgGetValue "Username" username
  20.  
  21. IF result = 0 THEN
  22.     GetInput "Enter your user name" username
  23.     IF result = 0 THEN
  24.         PRINT "Warning, no username entered"
  25.     ELSE
  26.         PRINT "Username set to ["; username; "]"
  27.     ENDIF
  28. ENDIF
  29.  
  30. # get password from access method
  31. # if the Password field is empty, prompt the user for it.
  32. CfgGetValue "Password" password
  33. IF result = 0 THEN
  34.     GetPassword "Enter your password" password
  35.     IF result = 0 THEN
  36.         PRINT "Warning, no password entered"
  37.     ELSE
  38.         # NOTE: Don't print password.
  39.         PRINT "Password set."
  40.     ENDIF
  41. ENDIF
  42.  
  43. # get framing layer (MPPPP, MPSLIP)
  44. # abort with an error if we can't read the Framing setting
  45. CfgGetValue "Framing" framing
  46. IF result = 0 THEN
  47.     ABORT "Can't read 'Framing' setting from qdeck.ini"
  48. ENDIF
  49.  
  50. CommWaitFor "Login:"           # wait for login prompt
  51. IF framing = "MPSLIP" THEN
  52.      CommSend "S"
  53. ELSE
  54.      CommSend "P"
  55. ENDIF
  56.  
  57. CommSend username              # send user name
  58. CommSend "%r"                  # send carriage return
  59.  
  60. CommWaitFor "Password:"        # wait for password prompt
  61.     CommSend password          # send password
  62.     CommSend "%r"              # send carriage return
  63.  
  64. IF framing = "MPSLIP" THEN              # if SLIP, we need to  get the IP address
  65.     PRINT "%rGetting IP address for SLIP"
  66.     CommWaitFor "Your IP Address is"    # wait for string that precedes the reported IP address
  67.     CommReadIPAddr IPAddress            # IP address should be next word
  68.     # store the IP address
  69.     CfgSetValue "IPAddress" IPaddress
  70.     PRINT "%rIP Address set to ["; IPAddress; "]"
  71. ENDIF                                   # end of SLIP logic
  72.  
  73. END                          
  74.